/*********************************************************************
 *
 *	Hardware specific definitions for:
 *    - %HUMAN_BOARD%
 *    - %SUPPORTED_PROCESSORS%
 *    - %NETWORK_INTERFACE%
 *
 *********************************************************************
 * FileName:        HardwareProfile.h
 * Dependencies:    Compiler.h
 * Processor:       <C18>PIC18</C18><C30>PIC24F, PIC24H, dsPIC30F, dsPIC33F</C30><C32>PIC32</C32>
<C32> * Compiler:        Microchip C32 v1.11 or higher</C32>
<C30> * Compiler:        Microchip C30 v3.24 or higher</C30>
<C18> * Compiler:        Microchip C18 v3.36 or higher</C18>
 * Company:         Microchip Technology, Inc.
 *
 * Software License Agreement
 *
 * Copyright (C) 2002-2010 Microchip Technology Inc.  All rights
 * reserved.
 *
 * Microchip licenses to you the right to use, modify, copy, and
 * distribute:
 * (i)  the Software when embedded on a Microchip microcontroller or
 *      digital signal controller product ("Device") which is
 *      integrated into Licensee's product; or
 * (ii) ONLY the Software driver source files ENC28J60.c, ENC28J60.h,
 *		ENCX24J600.c and ENCX24J600.h ported to a non-Microchip device
 *		used in conjunction with a Microchip ethernet controller for
 *		the sole purpose of interfacing with the ethernet controller.
 *
 * You should refer to the license agreement accompanying this
 * Software for additional information regarding your rights and
 * obligations.
 *
 * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT
 * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
 * LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A
 * PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
 * MICROCHIP BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR
 * CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF
 * PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS
 * BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE
 * THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, OR OTHER
 * SIMILAR COSTS, WHETHER ASSERTED ON THE BASIS OF CONTRACT, TORT
 * (INCLUDING NEGLIGENCE), BREACH OF WARRANTY, OR OTHERWISE.
 *
 *
 * Author               Date		Comment
 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Howard Schlunder		09/16/2010	Regenerated for specific boards
 ********************************************************************/
#ifndef HARDWARE_PROFILE_H
#define HARDWARE_PROFILE_H

#include "Compiler.h"

// Set configuration fuses (but only in MainDemo.c where THIS_IS_STACK_APPLICATION is defined)

// Clock frequency values
// These directly influence timed events using the Tick module.  They also are used for UART and SPI baud rate generation.

#define GetSystemClock()		(8000000ul)			// Hz
#define GetInstructionClock()	GetSystemClock()/2	// Normally GetSystemClock()/4 for PIC18, GetSystemClock()/2 for PIC24/dsPIC, and GetSystemClock()/1 for PIC32.  Might need changing if using Doze modes.
#define GetPeripheralClock()	GetSystemClock()/2	// Normally GetSystemClock()/4 for PIC18, GetSystemClock()/2 for PIC24/dsPIC, and GetSystemClock()/1 for PIC32.  Divisor may be different if using a PIC32 since it's configurable.


// Hardware I/O pin mappings

// MRF24WB0M
#define WF_CS_TRIS			(TRISBbits.TRISB4)
#define WF_CS_IO			(LATBbits.LATB4)
#define WF_SDI_TRIS			(TRISBbits.TRISB9)
#define WF_SCK_TRIS			(TRISBbits.TRISB8)
#define WF_SDO_TRIS			(TRISBbits.TRISB6)
#define WF_RESET_TRIS		(TRISBbits.TRISB12)
#define WF_RESET_IO			(PORTBbits.RB12)
#define WF_HIBERNATE_TRIS	(TRISAbits.TRISA4)
#define	WF_HIBERNATE_IO		(PORTAbits.RA4)
#define WF_INT_TRIS			(TRISBbits.TRISB7)
#define WF_INT_IO			(PORTBbits.RB7)
#define WF_INT_EDGE			(INTCON2bits.INT1EP)
#define WF_INT_IE			(IEC1bits.INT1IE)
#define WF_INT_IF			(IFS1bits.INT1IF)
#define WF_SSPBUF			(SPI1BUF)
#define WF_SPISTAT			(SPI1STAT)
#define WF_SPISTATbits		(SPI1STATbits)
#define WF_SPICON1			(SPI1CON1)
#define WF_SPICON1bits		(SPI1CON1bits)
#define WF_SPICON2			(SPI1CON2)
#define WF_SPI_IE			(IEC0bits.SPI1IE)
#define WF_SPI_IF			(IFS0bits.SPI1IF)

#endif // #ifndef HARDWARE_PROFILE_H
